Ext.define('App.datacollection.interface.model.CollectionInterfaceViewModel', {
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.CollectionInterfaceViewModel',
    requires: ['App.datacollection.interface.model.CollectionInterfaceModel'],
    data: {
        columns: [{
            text: 'ID',
            dataIndex: 'id',
            hidden: true,
            sortable: false
        }, {
            text: '接口类型',
            dataIndex: 'type'
        }, {
            text: '接口名称',
            dataIndex: 'name'
        }, {
            text: '接口地址',
            dataIndex: 'baseUrl'
        }, {
            text: '参数列表',
            dataIndex: 'parameters'
        }, {
            text: '描述',
            dataIndex: 'description'
        }],
        search: {
            fields: [{
                name: "接口类型",
                field: 'type',
                vtype: 's',
                defaultValue: '',
                opt: '=',
                datas: [['TMSS', 'TMSS'], ['DTS', 'DTS'], ['ICP-CI','ICP-CI']]
            }, {
                name: "接口名称",
                field: 'name',
                vtype: 's',
                defaultValue: '',
                opt: 'like',
                datas: null
            }]
        }
    },
    stores: {
        Query: {
            autoLoad: false,
            model: 'App.datacollection.interface.model.CollectionInterfaceModel',
            pageSize: 25,
            remoteSort: true,
            proxy: {
                type: 'majax',
                url: 'datacollection/interface/query',
                reader: {
                    type: 'json',
                    rootProperty: 'data',
                    totalProperty: 'total'
                }
            }
        }
    }
});